[#ftl]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>添加数据项</title>
<link rel="stylesheet" type="text/css" href="${base}/css/date.css" />
<link rel="stylesheet" type="text/css" href="${base}/css/base.css" />
<link rel="stylesheet" type="text/css" href="${base}/css/form.css" />
<link rel="stylesheet" type="text/css" href="${base}/commonjs/ztree/css/zTreeStyle/zTreeStyle.css" />
<link rel="stylesheet" type="text/css" href="${base}/css/zebra_dialog.css" />
<link rel="stylesheet" type="text/css" href="${base}/css/pop.css" />


<script type="text/javascript" src="${base}/commonjs/jquery1.7.2/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="${base}/commonjs/jquery-forms.js"></script>
<script type="text/javascript" src="${base}/commonjs/artDialog4/artDialog.source.js?skin=blue"></script>
<script type="text/javascript" src="${base}/commonjs/artDialog4/plugins/iframeTools.source.js"></script>
<script type="text/javascript"  src="${base}/js/zebra_dialog.js"></script>
<script type="text/javascript" src="${base}/commonjs/message/message.js"></script>
<script type="text/javascript" src="${base}/commonjs/noty/jquery.noty.packaged.min.js"></script>
<script type="text/javascript" src="${base}/commonjs/jquery-validation/jquery.validate.min.js" ></script>
<script type="text/javascript" src="${base}/commonjs/jquery-validation/localization/messages_zh.js" ></script>
<script type="text/javascript" src="${base}/commonjs/tab/tabs.js"></script>
</head>
<body>
<!-- 主体开始 -->
<div class="dataForm">
		<div id="eva_tab1" class="eva_tab">
			<form id="dataform" action="add" method="post">
				<div class="content mt10">
				<input  id="dictId" name="dictId"   type="hidden"  value="${dictid!''}"/>
					<dl>
					<dt>名称</dt>
					<dd>			
					<input  name="name" id="name"  type="text" />
					</dd>
					
					<dt>代码</dt>
					<dd>			
					<input  name="code" id="code"  type="text"  />
					</dd>

					<dt>值</dt>
					<dd>
						<input  name="value" id="value"  type="text"  />
					</dd>
					<dt>次序</dt>
					<dd><input   name="showOrder" id="showOrder"  type="text"  />
					</dd>
					<div class="clear"></div>
				</div>
				<div class="pop_btn">
					<input type="button" id="butSave" class="btn_1" value="保存"/>
					<input type="button" id="butCancel" class="btn_1" value="取消"/>
			    </div>
			</form>						
		</div>				
</div>
<script type="text/javascript">	
	$(function() {
	    $("#butSave").click(function(){	
			 $("#dataform").submit();			
  		 });

		var v = jQuery("#dataform").validate({
		 submitHandler: function(form) {
			$(form).ajaxSubmit({
			    url:"${base}/dictionary/addItem",
				success: function(data){  
                        noty({
                          text:extendMessages(data).msg.message,
                          layout:"center",
                          timeout:2000,
                          callback:{
                             afterClose:function(){
                                          window.parent.location.reload();
                                        }
                           }
                        });
               }
			});
		}
 });
	$("#butCancel").click(function(){
		window.parent.location.reload();
	});
		
	});
	
</script>

</body>
</html>